const pxtovm = require('postcss-px-to-viewport')
const path = require('path')
module.exports = {
    devServer:{
        proxy: {
            '/api': {
                target: 'http://localhost:3005/',
                changeOrigin: true,
                pathRewrite:{
                    // '^/api':' '
                }
            }
        }
    },
    
    css: {
        loaderOptions: {
            css: {
                // 这里的选项会传递给 css-loader
            },
            postcss: {
                // 这里的选项会传递给 postcss-loader
                plugins: [
                    new pxtovm({
                        unitToConvert: 'px',
                        viewportWidth: 375,
                        unitPrecision: 5,
                        propList: ['*'],
                        viewportUnit: 'vw',
                        fontViewportUnit: 'vw',
                        selectorBlackList: [],
                        minPixelValue: 1,
                        mediaQuery: false,
                        replace: true,
                        exclude: []
                    })
                ]
            }
        }
    },
    chainWebpack: config => {
        return config.resolve.alias
            .set('assets', path.resolve(__dirname, './src/assets/'))
    }
}